package task_02;

import java.util.Scanner;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/4/13 9:44
 * @description:
 */
public class PrinterTest {

  public static void main(String[] args) {

    System.out.println("请输入0或1");
    Scanner scanner = new Scanner(System.in);
    int s = scanner.nextInt();
    Printer a1 = new HPrinter();
    Printer a2 = new CPrinter();
    if (s == 0) {
      a1.open();
      a1.print();
      a1.close();
    } else if (s == 1) {
      a2.open();
      a2.print();
      a2.close();
    } else {
      System.out.println("输入有误,请输入指定数字");
    }
  }
}

